#ifndef __OPTPARSE_H
#define __OPTPARSE_H

typedef int (*cconf_opt_handler_fcn_t)(int ch, const char * name, char * arg, void * data);

typedef struct cconf_optlist_s cconf_optlist_t;

cconf_optlist_t * cconf_optlist_create(cconf_opt_handler_fcn_t fcn, void * handler_data);
void cconf_optlist_free(cconf_optlist_t * o);

int cconf_optlist_append(cconf_optlist_t * o, char * name, int has_arg, int val);

int cconf_optlist_parse(cconf_optlist_t * o, int argc, char ** argv);

#endif
